<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateMenuTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup styleClass="create" layout="block">
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateMenuLabel_nom}" for="nom" />
                    <h:inputText id="nom" value="#{menuController.selected.nom}" title="#{bundle.CreateMenuTitle_nom}" required="true" requiredMessage="#{bundle.CreateMenuRequiredMessage_nom}"/>
                    <h:outputLabel value="#{bundle.CreateMenuLabel_montant}" for="montant" />
                    <h:inputText id="montant" value="#{menuController.selected.montant}" title="#{bundle.CreateMenuTitle_montant}" required="true" requiredMessage="#{bundle.CreateMenuRequiredMessage_montant}"/>
                    <h:outputLabel value="#{bundle.CreateMenuLabel_dateDebut}" for="dateDebut" />
                    <h:inputText id="dateDebut" value="#{menuController.selected.dateDebut}" 
                                 title="#{bundle.CreateMenuTitle_dateDebut}" required="true" 
                                 requiredMessage="#{bundle.CreateMenuRequiredMessage_dateDebut}">
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateMenuLabel_promotion}" for="promotion" />
                    <h:inputText id="promotion" value="#{menuController.selected.promotion}" title="#{bundle.CreateMenuTitle_promotion}" />
                    <h:outputLabel value="#{bundle.CreateMenuLabel_produits}" for="produits" />
                    <h:selectManyListbox id="produits" value="#{menuController.produitsAAjouter}" size="10" >
                        <f:selectItems value="#{produitController.itemsAvailableSelectMany}"/>
                    </h:selectManyListbox>
                </h:panelGrid>
                <br />
                <h:panelGroup styleClass="boutons" layout="block">
                    <h:commandLink styleClass="enregistrer" action="#{menuController.create}" value="#{bundle.CreateMenuSaveLink}" />
                    <br />
                    <br />
                    <h:commandLink styleClass="retour" action="#{menuController.prepareList}" value="#{bundle.CreateMenuShowAllLink}" immediate="true"/>
                </h:panelGroup>
            </h:panelGroup>
        </ui:define>
    </ui:composition>

</html>
